﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;

namespace 草稿1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.CenterScreen;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //string str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:/C#/考核六/k6.mdb";
            //OleDbConnection oc = new OleDbConnection();
            //oc.ConnectionString = str;
            //oc.Open();
            //OleDbCommand ocm = new OleDbCommand();
            //string str1 = "select * from zym";
            //ocm.CommandText = str1;
            //ocm.Connection = oc;
            //OleDbDataReader or = ocm.ExecuteReader();
            //List<string> yhm = new List<string>();
            //List<string> mm = new List<string>();
            //while (or.Read())
            //{
            //    yhm.Add(or[1].ToString());
            //    mm.Add(or[2].ToString());
            //}
            //for (int i = 0; i <= yhm.Count - 1; i++)
            //{
            //    if (textBox1.Text == yhm[i] && textBox2.Text == mm[i])
            //    {
            //        Form2 f2 = new Form2();
            //        this.Hide();
            //        f2.Show();
            //        break;
            //    }
            //    if (i >= yhm.Count - 1)
            //    {
            //        MessageBox.Show("用户名或密码错误");
            //    }
            //}
            //oc.Close();
            OpenFileDialog odf = new OpenFileDialog();
            odf.ShowDialog();
            string str = odf.FileName;
            textBox1.Text = str;
        }
    }
}
